
include( 'cl_datastream.lua' )
datastream.Load()

gDisplayJunk = true
gFrameType = 0
gAllowScreenEffects = true
gOverridePlayerMove = false
gViewData = {Position = Vector(0,10,0), Angles = Angle(0,0,0), Zoom = 70 }

include( 'shared.lua' )
include( 'tables.lua' )
include( 'achievements.lua' )
include( 'cl_spawnmenu.lua' )
include( 'cl_postprocess.lua' )
include( 'cl_deathnotice.lua' )
include( 'cl_interface.lua' )

function GM:Initialize( )	

	self.BaseClass:Initialize()
	GAMEMODE:SetupTeams()
	
	WindVector = Vector(math.random(-20,20),math.random(-20,20),0) //fake random wind velocity for clientside effects
	
	MaxHealth = 100
	CurMenu = nil
	OpenHelp = false
	SplashScreen = false
	AchievementIDs = {}
	
	surface.CreateFont( "coolvetica", 10, 500, true, false, "ScoreboardHead" ) 
 	surface.CreateFont( "coolvetica", 8, 500, true, false, "ScoreboardSub" ) 
 	surface.CreateFont( "Tahoma", 10, 1000, true, false, "ScoreboardText" ) 
	surface.CreateFont( "Tahoma", 14, 600, true, false, "HudText" )

 
end
 
function GM:Think()

	if LocalPlayer() and LocalPlayer():IsValid() then
		if not LocalPlayer():Alive() then
			if CurMenu then
				CurMenu:Remove()
				gui.EnableScreenClicker(false)
				CurMenu = nil
			end
		end
	end
end	

local WalkTimer = 0
local VelSmooth = 0
function GM:CalcView( ply, origin, angle, fov )

	if gOverridePlayerMove then
		
		return {origin = gViewData.Position, angles = gViewData.Angles, fov = gViewData.Zoom}
		//self.BaseClass:CalcView( ply, gViewData.Position, gViewData.Angles, gViewData.Zoom)
	else

		local vel = ply:GetVelocity()
		local ang = ply:EyeAngles()
		
		VelSmooth = VelSmooth * 0.5 + vel:Length() * 0.1
		WalkTimer = WalkTimer + VelSmooth * FrameTime() * 0.05
		
		//angle.roll = angle.roll + ang:Right():DotProduct( vel ) * 0.005
		
		// they have ragdoll so view from its eyes
		/*local corpse = LocalPlayer():GetRagdollEntity()
		if corpse and ViewCorpse then
			local headpos = corpse:LookupAttachment("eyes")
			local att = corpse:GetAttachment(headpos)
			local view = {}
			view.origin = att.Pos + (att.Ang:Forward() * 1.2)
			view.angles = att.Ang
			return view
		end*/
		
		// make their view tilt when they strafe
		/*if ply:GetGroundEntity() != NULL then	
			angle.roll = angle.roll + math.sin( WalkTimer ) * VelSmooth * 0.001
			angle.pitch = angle.pitch + math.sin( WalkTimer * 0.3 ) * VelSmooth * 0.001
		end*/
			
		return self.BaseClass:CalcView( ply, origin, angle, fov )
	end
end

function GM:PostProcessPermitted( name )
	return false
end

function GM:PlayerBindPress( ply, bind, pressed )
	if not pressed then return false end
	if bind == "toggle_zoom" then
		return true
	elseif bind == "+menu" then
		RunConsoleCommand("+achievements_menu")
	elseif bind == "+menu_context" then
		//RunConsoleCommand("+model_menu")
		PlayerModelMenu()
	end
end


function GM:HUDPaint()

	if gFrameType == 1 then
		local vertViewSpace = ScrW() / (16.0 / 9.0)
		surface.SetDrawColor( 0, 0, 0, 255 )
		surface.DrawRect( 0, 0, ScrW(), (ScrH() / 2) - (vertViewSpace / 2))
		surface.DrawRect(0, 0 + (ScrH() / 2) + (vertViewSpace / 2), ScrW(), (ScrH() / 2) - (vertViewSpace / 2))
	elseif gFrameType == 2 then
		local vertViewSpace = ScrW() / (2.35 / 1.0)
		surface.SetDrawColor( 0, 0, 0, 255 )
		surface.DrawRect( 0, 0, ScrW(), (ScrH() / 2) - (vertViewSpace / 2))
		surface.DrawRect(0, 0 + (ScrH() / 2) + (vertViewSpace / 2), ScrW(), (ScrH() / 2) - (vertViewSpace / 2))
	end


	//local CamData = {}
	//CamData.x = 10
	//CamData.y = 10
	//CamData.w = 256
	//CamData.h = 256
	//CamData.fov = 90

	//CamData.angles = LocalPlayer():GetAngles()
	//CamData.origin = LocalPlayer():GetPos()

	//surface.SetDrawColor( 0, 0, 0, 150 )
	//surface.DrawRect( 0, 0, ScrW(), ScrH() )

	//render.RenderView( CamData )
	//
	//local w = ScrW()
	//local h = ScrH()
	//draw.RoundedBox( 6, w*.02, h*.94, w*.17, h*.04, Color(30,30,30,200) ) //background
	//draw.RoundedBox( 6, w*.03, h*.95, w*.12, h*.02, Color(250,250,250,200) ) // white bar

	//cam.Start3D(LocalPlayer():EyePos(), LocalPlayer():EyeAngles())  
 //   render.SetMaterial(Material("VGUI/halohud/hud_multiplayer"))  
 //   render.DrawQuadEasy(LocalPlayer():GetPos()+LocalPlayer():GetUp() * 80,LocalPlayer():GetPos()-LocalPlayer():GetPos(),32,16)  
	//cam.End3D() 
end
//local tex_Bloom0 = render.GetBloomTex0()  
//local OldRT = render.GetRenderTarget(); // Grab the current render target 
//render.SetRenderTarget( tex_Bloom0 );// Set to a new render target 
//render.DrawScreenQuad(); // Draw the screen to the new render target 
//render.SetRenderTarget( OldRT );  // Restore the old render target  
//
//local w = ScrW()
//local h = ScrH()
//draw.RoundedBox( 6, w*.02, h*.94, w*.17, h*.04, Color(30,30,30,200) ) //background
//draw.RoundedBox( 6, w*.03, h*.95, w*.12, h*.02, Color(250,250,250,200) ) // white bar
//end
//
//local CircleParams = {["$basetexture"] = "pp/morph/brush_outline",
//["$ignorez"] = 0,
//["$additive"] = 1,
//["$vertexcolor"] = 1,
//["$vertexalpha"] = 1,
//["$nolod"] = 1,
//["$nocull"] = 1}
//local CircleMat = CreateMaterial("PlayerCircle","UnlitGeneric",CircleParams);
//
//local function DrawPlayerCircles()
//
//	if not DrawCircles then return end
//
//	cam.Start3D( EyePos(), EyeAngles() )
//	
//	for k,v in pairs(player.GetAll()) do
//		if v != LocalPlayer() and v:Alive() then
//	
//			local trace = {}
//			trace.start 	= v:GetPos() + Vector(0,0,50)
//			trace.endpos 	= trace.start + Vector(0,0,-300)
//			trace.filter 	= v
//			local tr = util.TraceLine( trace )
//		
//			if not tr.HitWorld then
//				tr.HitPos = v:GetPos()
//			end
//
//			local color = team.GetColor( v:Team() )
//			
//			render.SetMaterial( CircleMat )
//			for i=47,51 do
//				render.DrawQuadEasy( tr.HitPos, tr.HitNormal, i, i, color )
//			end
//		end
//	end
//	cam.End3D();
//	
//end
//hook.Add( "RenderScreenspaceEffects", "DrawPlayerCircles", DrawPlayerCircles )
//
//function SetDrawCircles( msg )
//	DrawCircles = msg:ReadBool()
//end
//usermessage.Hook("DrawCircles", SetDrawCircles) 
//
//local function DrawNotices()
//	if CurNotice then
//		if CurNotice.Time < CurTime() then 
//			CurNotice.Color.a = CurNotice.Color.a / 1.2
//			if CurNotice.Color.a < 10 then 
//				CurNotice = nil 
//				return 
//			end
//		end
//		
//		CurNotice.Pos = math.Clamp(CurNotice.Pos / 1.008, .951, 1)
//		
//		surface.SetFont( "HudText" )
//		local width, junk = surface.GetTextSize( CurNotice.Text )
//		
//		draw.RoundedBox( 6, w*.195, h*CurNotice.Pos, w*.02 + width, h*.02, Color(250,250,250,math.Clamp(CurNotice.Color.a,0,200))) //background
//		draw.DrawText(CurNotice.Text, "HudText", w*.205, h*(CurNotice.Pos + .001), CurNotice.Color, TEXT_ALIGN_LEFT)
//		
//	elseif Notices[1] then
//	
//		CurNotice = {Text=Notices[1].Text, Color=Notices[1].Color, Time=CurTime() + Notices[1].LifeTime, Pos=1}
//		MsgN(Notices[1].Text)
//		table.remove(Notices,1)
//		
//	end
//end
//hook.Add("HUDPaint","DrawNotices",DrawNotices)
//
//Notices = {}
//function Notice( msg )
//	local text = msg:ReadString()
//	local color = Color(255,255,255,255)
//	color.r = msg:ReadShort()
//	color.g = msg:ReadShort()
//	color.b = msg:ReadShort()
//	local lifetime = msg:ReadShort()
//	if not CurNotice then
//		CurNotice = {Text=text, Color=color, Time=CurTime() + lifetime, Pos=1}
//		MsgN(text)
//	else
//		table.insert(Notices,{Text=text, Color=color, LifeTime=lifetime})
//	end
//end
//usermessage.Hook("Notice", Notice) 
//
//local function DrawHelp()
//	if OpenHelp then
//		GAMEMODE:PaintHelp()
//	end
//end
//hook.Add("HUDPaint","DrawHelp",DrawHelp)
//
//function ShowHelp(msg)
//	OpenHelp = not OpenHelp
//end
//usermessage.Hook("ShowHelp", ShowHelp) 
//
//function GM:PaintHelp()
//	draw.RoundedBox( 8, w*.20, h*.20, w*.60, h*.60, Color(30,30,30,200) ) //background
//	draw.DrawText(GAMEMODE.Name.." by "..GAMEMODE.Author, "HudText", w*.50, h*.22, Color(255,255,255,255), TEXT_ALIGN_CENTER)
//	draw.DrawText("Press F1 again to close this menu!", "HudText", w*.50, h*.24, Color(55,255,55,255), TEXT_ALIGN_CENTER)
//	local example = {"This gamemode doesn't have a help menu coded!",
//	"Bitch at the guy who coded it!",
//	"-Sechs"}
//	local pos = .30
//	for k,v in pairs(example) do
//		draw.DrawText(v, "HudText", w*.22, h*pos, Color(255,255,255,255), TEXT_ALIGN_LEFT)
//		pos = pos + .02
//	end
//end
//
//function GM:SplashScreenInit()
//	SplashTime = CurTime() + 5
//	surface.CreateFont( "Tahoma", 20, 600, true, false, "SplashText" )
//end
//
//function GM:PaintSplashScreen()
//	if not SplashTime then return end
//	if SplashTime < CurTime() then
//		hook.Remove("HUDPaint","PaintSplashScreen") //get rid of this hook once it is done displaying
//		surface.PlaySound("vo/npc/barney/ba_yell.wav") //yay
//	end
//	draw.RoundedBox( 8, w*.30, h*.45, w*.40, h*.10, Color(30,30,30,200) ) //background
//	draw.DrawText("THE SIMPLE GAME BASE!", "SplashText", w*.50, h*.46, Color(55,255,55,255), TEXT_ALIGN_CENTER)
//	draw.DrawText("LOLOLOLOL", "SplashText", w*math.Rand(.49,.51), h*.52, Color(255,255,55,255), TEXT_ALIGN_CENTER)
//end
//
//local function PaintSplashScreen()
//	GAMEMODE:PaintSplashScreen()
//end
//hook.Add("HUDPaint","PaintSplashScreen",PaintSplashScreen)
//
//function TimedSin(freq,min,max,offset)
//    return math.sin(freq * math.pi * 2 * CurTime() + offset) * (max-min) * 0.5 + min
//end 
//
//function TimeScale(cur,maxtime)
//	if CurTime() > maxtime then return 1 end
//	return math.min((CurTime() - cur) / (maxtime - cur),maxtime)
//end
//
//function TimeFormat(CurTime,DesTime)
//
//	if DesTime == nil then return "00:00" end
//
//	if CurTime >= DesTime then return "00:00" end
//	local Time = DesTime - CurTime
//
//    local Seconds = Time % 60
//    local Minutes = math.floor(Time/60) % 60
//    local NewTime = ""
//       
//    if Minutes < 10 then
//        NewTime = NewTime.."0"..Minutes..":"
//    else NewTime = NewTime..Minutes..":" end
//   
//    if Seconds < 10 then
//        NewTime = NewTime.."0"..math.floor(Seconds)
//    else NewTime = NewTime..math.floor(Seconds) end
//   
//    return NewTime
//end
//
//function HealthBonus(msg)
//	ColorModify[ "$pp_colour_addr" ]		= .4
//	ColorModify[ "$pp_colour_addb" ]		= .7
//	ColorModify[ "$pp_colour_mulb" ] 		= .5
//end
//usermessage.Hook("HealthKit", HealthBonus) 
//
//function HealthTiny(msg)
//	ColorModify[ "$pp_colour_addr" ]		= .2
//	ColorModify[ "$pp_colour_addb" ]		= .5
//	ColorModify[ "$pp_colour_mulb" ] 		= .3
//end
//usermessage.Hook("HealthTiny", HealthTiny) 
//
//function HealthLoss(msg)
//	ColorModify[ "$pp_colour_addr" ]		= .8
//	ColorModify[ "$pp_colour_addg" ]		= .2
//	ColorModify[ "$pp_colour_mulr" ] 		= .7
//end
//usermessage.Hook("HealthLoss", HealthLoss) 
//
//function SetMaxHealth( msg )
//	MaxHealth = msg:ReadShort()
//end
//usermessage.Hook("MaxHealth", SetMaxHealth) 
//
//function SetViewPos(msg)
//	local pos = msg:ReadVector()
//	if pos != nil and pos != 0 then
//		ViewPos = pos
//	else
//		ViewPos = nil
//	end
//end
//usermessage.Hook("SetViewPos", SetViewPos) 
//
//function SetViewEnt(msg)
//	local ent = msg:ReadEntity()
//	if ent != nil and ent != 0 then
//		if ent:IsValid() then
//			ViewEnt = ent
//		end
//	else
//		ViewEnt = nil
//	end
//end
//usermessage.Hook("SetViewEnt", SetViewEnt) 
//
//function SetViewClientCorpse( msg )
//	ViewCorpse = msg:ReadBool()
//end
//usermessage.Hook("SetViewClientCorpse",SetViewClientCorpse) 
//
//function PlaySound( msg )
//	local sound = msg:ReadString()
//	if LocalPlayer() then
//		LocalPlayer():EmitSound(sound,110,100)
//	end
//end
//usermessage.Hook("PlaySound", PlaySound) 
//
//function UpdateGamemodesTable( msg )
//
//	local name = msg:ReadString()
//	local foldername = msg:ReadString()
//	local tblsize = msg:ReadShort()
//	local maptbl = {}
//	for i=1, tblsize do
//		table.insert(maptbl,msg:ReadString())
//	end
//	table.insert(Votes.Gamemodes,{name,foldername,maptbl})
//end
//usermessage.Hook("UpdateGamemodesTable", UpdateGamemodesTable) 
//
//function GameVoteMenu( msg )
//
//	gui.EnableScreenClicker(true)
//	local randomgame = ChooseRandom(Votes.Gamemodes)
//	SelectedGamemode = {}
//	SelectedGamemode[1] = randomgame[1]
//	SelectedGamemode[2] = randomgame[2]
//	
//	local frame = vgui.Create("DFrame")
//	frame:SetSize(200,300)
//	frame:SetPos(ScrW()/2 - 100,ScrH()/2 - 150)
//	frame:SetTitle("Gamemode Vote Menu")
//	frame.Close = function() end
//	
//	local list = vgui.Create("DListView",frame)
//	list:SetPos(15,30)
//	list:SetSize(170, 200)
//	
//	local column = list:AddColumn( "Gamemodes" ) 
//	column:SetMinWidth( 170 )
//	column:SetMaxWidth( 170 )
//	
//	for k,v in pairs(Votes.Gamemodes) do
//		list:AddLine(v[1])
//	end
//	
//	list.OnRowSelected = function(ID,line) 
//		SelectedGamemode[1] = Votes.Gamemodes[line][1]
//		SelectedGamemode[2] = Votes.Gamemodes[line][2]
//	end
//	
//	local button = vgui.Create("DButton",frame)
//	button:SetText("Random Vote")
//	button:SetPos(15,250)
//	button:SetSize(90,30)
//	button.DoClick = function()
//		gui.EnableScreenClicker(false) 
//		frame:Remove() 
//		randomgame = ChooseRandom(Votes.Gamemodes)
//		SelectedGamemode[1] = randomgame[1]
//		SelectedGamemode[2] = randomgame[2]
//		RunConsoleCommand("castgamevote",SelectedGamemode[1],SelectedGamemode[2]) 
//	end
//	
//	local button = vgui.Create("DButton",frame)
//	button:SetText("Cast Vote")
//	button:SetPos(115,250)
//	button:SetSize(70,30)
//	button.DoClick = function()
//		gui.EnableScreenClicker(false) 
//		frame:Remove() 
//		RunConsoleCommand("castgamevote",SelectedGamemode[1],SelectedGamemode[2]) 
//	end
//	
//end
//usermessage.Hook("GameVoteMenu", GameVoteMenu) 
//
//function MapVoteMenu( msg )
//
//	Votes.Maps = {}
//	local amt = msg:ReadShort()
//	for i=1,amt do
//		local map = msg:ReadString()
//		if not table.HasValue(Votes.Maps,map) then
//			table.insert(Votes.Maps,map)
//		end
//	end
//
//	gui.EnableScreenClicker(true)
//	SelectedMap = ChooseRandom(Votes.Maps)
//	
//	local frame = vgui.Create("DFrame")
//	frame:SetSize(200,300)
//	frame:SetPos(ScrW()/2 - 100,ScrH()/2 - 150)
//	frame:SetTitle("Map Vote Menu")
//	frame.Close = function() end
//	
//	local list = vgui.Create("DListView",frame)
//	list:SetPos(15,30)
//	list:SetSize(170, 200)
//	
//	local column = list:AddColumn( "Maps" ) 
//	column:SetMinWidth( 170 )
//	column:SetMaxWidth( 170 )
//	
//	for k,v in pairs(Votes.Maps) do
//		list:AddLine(v)
//	end
//	
//	list.OnRowSelected = function(ID,line) 
//		SelectedMap = Votes.Maps[line]
//	end
//	
//	local button = vgui.Create("DButton",frame)
//	button:SetText("Random Vote")
//	button:SetPos(15,250)
//	button:SetSize(90,30)
//	button.DoClick = function()
//		gui.EnableScreenClicker(false) 
//		frame:Remove() 
//		SelectedMap = ChooseRandom(Votes.Maps)
//		RunConsoleCommand("castmapvote",SelectedMap) 
//	end
//	
//	local button2 = vgui.Create("DButton",frame)
//	button2:SetText("Cast Vote")
//	button2:SetPos(115,250)
//	button2:SetSize(70,30)
//	button2.DoClick = function()
//		gui.EnableScreenClicker(false) 
//		frame:Remove() 
//		RunConsoleCommand("castmapvote",SelectedMap) 
//	end
//	
//end
//usermessage.Hook("MapVoteMenu", MapVoteMenu) 
//
//list.Set( "PlayerModels", "kleiner", 	"models/player/Kleiner.mdl" )
//list.Set( "PlayerModels", "mossman", 	"models/player/mossman.mdl" )
//list.Set( "PlayerModels", "alyx", 		"models/player/alyx.mdl" )
//list.Set( "PlayerModels", "barney", 	"models/player/barney.mdl" )
//list.Set( "PlayerModels", "breen", 		"models/player/breen.mdl" )
//list.Set( "PlayerModels", "odessa", 	"models/player/odessa.mdl" )
//list.Set( "PlayerModels", "monk", 		"models/player/monk.mdl" )
//list.Set( "PlayerModels", "eli", 		"models/player/eli.mdl" )
//list.Set( "PlayerModels", "corpse", 	"models/player/corpse1.mdl" )
//list.Set( "PlayerModels", "zombie", 	"models/player/classic.mdl" )
//list.Set( "PlayerModels", "charple", 	"models/player/charple01.mdl" )
//list.Set( "PlayerModels", "combine", 	"models/player/combine_soldier.mdl" )
//list.Set( "PlayerModels", "prison", 	"models/player/combine_soldier_prisonguard.mdl" )
//list.Set( "PlayerModels", "super", 		"models/player/combine_super_soldier.mdl" )
//list.Set( "PlayerModels", "police", 	"models/player/police.mdl" )
//list.Set( "PlayerModels", "gman", 		"models/player/gman_high.mdl" )
//list.Set( "PlayerModels", "stripped", 	"models/player/soldier_stripped.mdl" )
//list.Set( "PlayerModels", "zombine", 	"models/player/zombie_soldier.mdl" )
//list.Set( "PlayerModels", "fzombie", 	"models/player/Zombiefast.mdl" )
//
//list.Set( "PlayerModels",  "female1",	"models/player/Group01/female_01.mdl" )
//list.Set( "PlayerModels",  "female2",	"models/player/Group01/female_02.mdl" )
//list.Set( "PlayerModels",  "female3",	"models/player/Group01/female_03.mdl" )
//list.Set( "PlayerModels",  "female4",	"models/player/Group01/female_04.mdl" )
//list.Set( "PlayerModels",  "female5",	"models/player/Group01/female_06.mdl" )
//list.Set( "PlayerModels", "female6",	"models/player/Group01/female_07.mdl" )
//list.Set( "PlayerModels", "female7",	"models/player/Group03/female_01.mdl" )
//list.Set( "PlayerModels", "female8",	"models/player/Group03/female_02.mdl" )
//list.Set( "PlayerModels", "female9",	"models/player/Group03/female_03.mdl" )
//list.Set( "PlayerModels", "female10",	"models/player/Group03/female_04.mdl" )
//list.Set( "PlayerModels", "female11",	"models/player/Group03/female_06.mdl" )
//list.Set( "PlayerModels", "female12",	"models/player/Group03/female_07.mdl" )
//
//list.Set( "PlayerModels", "male1",		"models/player/Group01/male_01.mdl" )
//list.Set( "PlayerModels", "male2",		"models/player/Group01/male_02.mdl" )
//list.Set( "PlayerModels", "male3",		"models/player/Group01/male_03.mdl" )
//list.Set( "PlayerModels", "male4",		"models/player/Group01/male_04.mdl" )
//list.Set( "PlayerModels", "male5",		"models/player/Group01/male_05.mdl" )
//list.Set( "PlayerModels", "male6",		"models/player/Group01/male_06.mdl" )
//list.Set( "PlayerModels", "male7",		"models/player/Group01/male_07.mdl" )
//list.Set( "PlayerModels",  "male8",		"models/player/Group01/male_08.mdl" )
//list.Set( "PlayerModels",  "male9",		"models/player/Group01/male_09.mdl" )
//
//list.Set( "PlayerModels", "male10",		"models/player/Group03/male_01.mdl" )
//list.Set( "PlayerModels", "male11",		"models/player/Group03/male_02.mdl" )
//list.Set( "PlayerModels", "male12",		"models/player/Group03/male_03.mdl" )
//list.Set( "PlayerModels", "male13",		"models/player/Group03/male_04.mdl" )
//list.Set( "PlayerModels", "male15",		"models/player/Group03/male_06.mdl" )
//list.Set( "PlayerModels", "male16",		"models/player/Group03/male_07.mdl" )
//list.Set( "PlayerModels", "male17",		"models/player/Group03/male_08.mdl" )
//list.Set( "PlayerModels", "male18",		"models/player/Group03/male_09.mdl" )
//
//list.Set( "PlayerModels", "gasmask",	"models/player/gasmask.mdl" )
//list.Set( "PlayerModels", "riot",		"models/player/riot.mdl" )
//list.Set( "PlayerModels", "swat",		"models/player/swat.mdl" )
//list.Set( "PlayerModels", "urban",		"models/player/urban.mdl" )
//list.Set( "PlayerModels", "phoenix",	"models/player/phoenix.mdl" )
//list.Set( "PlayerModels", "arctic",		"models/player/arctic.mdl" )
//list.Set( "PlayerModels", "guerilla",	"models/player/guerilla.mdl" )
//list.Set( "PlayerModels", "leet",		"models/player/leet.mdl" )
//list.Set( "PlayerModels", "hostage_01",	"models/player/hostage/hostage_01.mdl" )
//list.Set( "PlayerModels", "hostage_02",	"models/player/hostage/hostage_02.mdl" )
//list.Set( "PlayerModels", "hostage_03",	"models/player/hostage/hostage_03.mdl" )
//list.Set( "PlayerModels", "hostage_04",	"models/player/hostage/hostage_04.mdl" )
//
//function PlayerModelMenu( msg )
//
//	if ModelMenuOpen then return end
//	ModelMenuOpen = true
//
//	gui.EnableScreenClicker(true)
//	
//	local frame = vgui.Create("DFrame")
//	frame:SetSize(400,400)
//	frame:SetPos(ScrW()/2 - 200,ScrH()/2 - 200)
//	frame:SetTitle("Playermodel Selection Menu")
//	frame.Close = function() 
//		RunConsoleCommand("setplayermodel","male2") 
//		frame:Remove() 
//		gui.EnableScreenClicker(false) 
//		ModelMenuOpen = false
//	end
//	
//	local plist = vgui.Create("DPanelList",frame)
//	plist:SetPos(30,30)
//	plist:SetSize(340, 340)
//	plist:SetSpacing( 1 )
//	plist:EnableHorizontal( true )
//	plist:EnableVerticalScrollbar( true ) 
//	
//	for name, model in pairs( list.Get( "PlayerModels" ) ) do
//		local icon = vgui.Create( "SpawnIcon", plist )
//		icon:SetModel( model )
//		icon:SetSize( 64, 64 )
//		icon.OnMousePressed = function(mc)
//			RunConsoleCommand("setplayermodel",name)
//			frame:Remove()
//			gui.EnableScreenClicker(false)
//			ModelMenuOpen = false
//			surface.PlaySound(Sound("buttons/button14.wav"))
//		end
//		plist:AddItem(icon)
//	end
//end
//usermessage.Hook("ModelMenu", PlayerModelMenu) 
//
//function AchievementsMenu( msg )
//
//	if Achievements.Menu then return end
//
//	gui.EnableScreenClicker(true)
//	AchievementIDs = {}
//	Achievements.Menu = true
//	
//	for i=1,msg:ReadShort() do
//		table.insert(AchievementIDs,msg:ReadString())
//	end
//	
//	local frame = vgui.Create("DFrame")
//	frame:SetSize(500,300)
//	frame:SetPos(ScrW()/2 - 250,ScrH()/2 - 200)
//	frame:SetTitle("Achievements Menu")
//	frame.Close = function() 
//		frame:Remove() 
//		gui.EnableScreenClicker(false) 
//		Achievements.Menu = false
//	end
//	
//	local img = vgui.Create("DImage",frame)
//	img:SetImage("gui/silkicons/wrench")
//	img:SetPos(31,260)
//	img:SizeToContents()
//	
//	local label = vgui.Create("DLabel",frame)
//	label:SetPos(70,260)
//	label:SetText("You've unlocked "..#AchievementIDs.." out of "..#Achievements.List.." achievements.")
//	label:SetSize(400,15)
//	
//	local list = vgui.Create("DListView",frame)
//	list:SetPos(30,30)
//	list:SetSize(440, 220)
//	
//	local c0 = list:AddColumn( "Achievement" ) 
//	local c1 = list:AddColumn( "Description" ) 
//	c0:SetMinWidth( 120 )
//	c0:SetMaxWidth( 120 )
//	
//	for k,v in pairs(Achievements.List) do
//		list:AddLine( v.Name, v.Desc )
//	end
//	
//	list.OnRowSelected = function(ID,line) 
//		if table.HasValue(AchievementIDs,""..Achievements.List[line].ID) then
//			img:SetImage("gui/silkicons/check_on")
//			label:SetText("You've unlocked this achievement.")
//		else
//			img:SetImage("gui/silkicons/check_off")
//			label:SetText("You haven't unlocked this achievement.")
//		end
//	end
//	
//end
//usermessage.Hook("AchievementsMenu", AchievementsMenu) 
//
//function AdminMenu( msg )
//
//	if AdminMenuOpen then return end
//	AdminMenuOpen = true
//	
//	gui.EnableScreenClicker(true) 
//	
//	local frame = vgui.Create("DFrame")
//	frame:SetSize(210,360)
//	frame:SetPos(ScrW()/2 - 105,ScrH()/2 - 150)
//	frame:SetTitle("Admin Menu")
//	frame.Close = function() 
//		frame:Remove() 
//		gui.EnableScreenClicker(false) 
//		AdminMenuOpen = false
//	end
//	
//	local sheet = vgui.Create( "DPropertySheet" )
//	sheet:SetParent( frame )
//	sheet:SetPos( 5, 30 )
//	sheet:SetSize( 200, 320 )
//	
//	local tab1 = vgui.Create( "DPanel" )
//	tab1:SetVisible(true)
//	local tab2 = vgui.Create( "DPanel" )
//	tab2:SetVisible(true)
//	
//	//SERVER ADMIN
//	
//	local list = vgui.Create("DListView",tab1)
//	list:SetPos(15,30)
//	list:SetSize(170, 200)
//	
//	local column = list:AddColumn( "Gamemodes" ) 
//	column:SetMinWidth( 170 )
//	column:SetMaxWidth( 170 )
//	
//	for k,v in pairs(Votes.Gamemodes) do
//		list:AddLine(v[1])
//	end
//	
//	list.OnRowSelected = function(ID,line) 
//		CallSelection = Votes.Gamemodes[line][2]
//	end
//	
//	local button = vgui.Create("DButton",tab1)
//	button:SetText("Random Pick")
//	button:SetPos(15,250)
//	button:SetSize(90,30)
//	button.DoClick = function()
//		AdminMenuOpen = false
//		gui.EnableScreenClicker(false) 
//		frame:Remove() 
//		local randomgame = ChooseRandom(Votes.Gamemodes)[2]
//		RunConsoleCommand("sg_loadvotemenu",randomgame) 
//	end
//	
//	local button = vgui.Create("DButton",tab1)
//	button:SetText("Call Vote")
//	button:SetPos(115,250)
//	button:SetSize(70,30)
//	button.DoClick = function()
//		if CallSelection then
//			AdminMenuOpen = false
//			gui.EnableScreenClicker(false) 
//			frame:Remove() 
//			RunConsoleCommand("sg_loadvotemenu",CallSelection)
//		end			
//	end
//	
//	//PLAYER ADMIN
//	
//	local list = vgui.Create("DListView",tab2)
//	list:SetPos(15,30)
//	list:SetSize(170, 200)
//	
//	local column = list:AddColumn( "Players" ) 
//	column:SetMinWidth( 170 )
//	column:SetMaxWidth( 170 )
//	
//	PlayerList = {}
//	for k,v in pairs(player.GetAll()) do
//		list:AddLine(v:Nick())
//		PlayerList[k] = v
//	end
//	
//	list.OnRowSelected = function(ID,line) 
//		SelectedPlayer = PlayerList[line]:Nick()
//	end
//	
//	local button = vgui.Create("DButton",tab2)
//	button:SetText("Kick")
//	button:SetPos(15,250)
//	button:SetSize(70,30)
//	button.DoClick = function()
//		if SelectedPlayer then
//			AdminMenuOpen = false
//			gui.EnableScreenClicker(false) 
//			frame:Remove() 
//			RunConsoleCommand("sg_kick",SelectedPlayer) 
//		end
//	end
//	
//	local button = vgui.Create("DButton",tab2)
//	button:SetText("Temp Ban")
//	button:SetPos(95,250)
//	button:SetSize(90,30)
//	button.DoClick = function()
//		if SelectedPlayer then
//			AdminMenuOpen = false
//			gui.EnableScreenClicker(false) 
//			frame:Remove() 
//			RunConsoleCommand("sg_ban",SelectedPlayer) 
//		end
//	end
//
//	sheet:AddSheet( "Server", tab1, "gui/silkicons/world", false, false, "Choose a new gamemode" )
//	sheet:AddSheet( "Players", tab2, "gui/silkicons/group", false, false, "Kick or ban players" )
//	
//end
//usermessage.Hook("SGAdminMenu", AdminMenu) 
//
function NoHud(name)
	return true
end
hook.Add("HUDShouldDraw", "NoDrawHud", NoHud)
